import Mock from 'mockjs'

const { data } = Mock.mock({
    'data|30': [
        {
            'file|1': [' 峰林三路市政管道设计图', '市政管道设计图', '文件夹名称'],
            'size|1': ['1M', '1G', '2.5T'],
            date: '@datetime'
        }
    ]
})

Mock.mock('/api/getArchiveList', 'post', () => {
    return {
        code: 200,
        message: '数据获取成功',
        data
    }
})

Mock.mock('/api/addArchive', 'post', (config: any) => {
    const { file, size, date } = JSON.parse(config.body)
    data.push({ file, size, date })
    return {
        code: 200,
        message: '添加成功',
        data
    }
})
